/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package py.com.peluq.model.entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Diego_M
 */
@Entity
@Table(name = "marcas", catalog = "peludb", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Marcas.findAll", query = "SELECT m FROM Marcas m"),
    @NamedQuery(name = "Marcas.findByIdMarcas", query = "SELECT m FROM Marcas m WHERE m.idMarcas = :idMarcas"),
    @NamedQuery(name = "Marcas.findByMarDescrip", query = "SELECT m FROM Marcas m WHERE m.marDescrip = :marDescrip")})
public class Marcas implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idMarcas", nullable = false)
    private Integer idMarcas;
    @Column(name = "mar_descrip")
    private Integer marDescrip;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "marcas")
    private EntidadAdherida entidadAdherida;

    public Marcas() {
    }

    public Marcas(Integer idMarcas) {
        this.idMarcas = idMarcas;
    }

    public Integer getIdMarcas() {
        return idMarcas;
    }

    public void setIdMarcas(Integer idMarcas) {
        this.idMarcas = idMarcas;
    }

    public Integer getMarDescrip() {
        return marDescrip;
    }

    public void setMarDescrip(Integer marDescrip) {
        this.marDescrip = marDescrip;
    }

    public EntidadAdherida getEntidadAdherida() {
        return entidadAdherida;
    }

    public void setEntidadAdherida(EntidadAdherida entidadAdherida) {
        this.entidadAdherida = entidadAdherida;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMarcas != null ? idMarcas.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Marcas)) {
            return false;
        }
        Marcas other = (Marcas) object;
        if ((this.idMarcas == null && other.idMarcas != null) || (this.idMarcas != null && !this.idMarcas.equals(other.idMarcas))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "py.com.peluq.model.entity.Marcas[ idMarcas=" + idMarcas + " ]";
    }
    
}
